<!DOCTYPE HTML>
<html lang="zh-CN">
<head><meta name="generator" content="Hexo 3.9.0">
    <!--Setting-->
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
    <meta http-equiv="Cache-Control" content="no-siteapp">
    <meta http-equiv="Cache-Control" content="no-transform">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta name="apple-mobile-web-app-capable" content="武威涛哥的博客">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no,email=no,adress=no">
    <meta name="browsermode" content="application">
    <meta name="screen-orientation" content="portrait">
    <meta name="theme-version" content="1.2.3">
    <meta name="root" content="/">
    <link rel="dns-prefetch" href="https://jaredtao.github.io">
    <!--SEO-->

    <meta name="keywords" content="Qt,持续集成(CI)">


    <meta name="description" content="简介本文的目标是，在github上实现Qt工程的自动化发行。
看个预览图先:
上图所示github的Release中，包含了两个macos平台的dmg包、5个windows平台的zip包以及一个...">



<meta name="robots" content="all">
<meta name="google" content="all">
<meta name="googlebot" content="all">
<meta name="verify" content="all">

    <!--Title-->

<title>
    
    Qt项目持续集成系列之-github自动化发行 |
    
    武威涛哥的博客
</title>

    <link rel="alternate" href="/atom.xml" title="武威涛哥的博客" type="application/atom+xml">


    <link rel="icon" href="/favicon.ico">

    



<link rel="stylesheet" href="/css/bootstrap.min.css?rev=3.3.7">
<link rel="stylesheet" href="/css/font-awesome.min.css?rev=4.7.0">
<link rel="stylesheet" href="/css/style.css?rev=@@hash">




    
	<div class="hide">
		<script type="text/javascript">
			var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");document.write(unescape("%3Cspan class='cnzz_stat_icon_1263868967 hide' %3E%3Cscript%20src%3D%22https%3A%2F%2Fs95.cnzz.com%2Fz_stat.php%3Fweb_id%3D1272564536%22%3E%3C%2Fscript%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s19.cnzz.com/z_stat.php%3Fid%3D1263868967%26show%3Dpic1' type='text/javascript'%3E%3C/script%3E"));
		</script>
	</div>






    

    <script>
        (function(){
            var bp = document.createElement('script');
            var curProtocol = window.location.protocol.split(':')[0];
            if (curProtocol === 'https') {
                bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
            }
            else {
                bp.src = 'http://push.zhanzhang.baidu.com/push.js';
            }
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(bp, s);
        })();
    </script>

</head>

</html>
<!--[if lte IE 8]>
<style>
    html{ font-size: 1em }
</style>
<![endif]-->
<!--[if lte IE 9]>
<div style="ie">你使用的浏览器版本过低，为了你更好的阅读体验，请更新浏览器的版本或者使用其他现代浏览器，比如Chrome、Firefox、Safari等。</div>
<![endif]-->

<body>
    <header class="main-header"  style="background-image:url(http://snippet.shenliyang.com/img/banner.jpg)"  >
    <div class="main-header-box">
        <a class="header-avatar" href="/" title='JaredTao'>
            <img src="/img/avatar.jpg" alt="logo头像" class="img-responsive center-block">
        </a>
        <div class="branding">
        	<!--<h2 class="text-hide">Snippet主题,从未如此简单有趣</h2>-->
            
                <h2> 传承工匠精神 </h2>
            
    	</div>
    </div>
</header>
    <nav class="main-navigation">
    <div class="container">
        <div class="row">
            <div class="col-sm-12">
                <div class="navbar-header"><span class="nav-toggle-button collapsed pull-right" data-toggle="collapse" data-target="#main-menu" id="mnav">
                    <span class="sr-only"></span>
                        <i class="fa fa-bars"></i>
                    </span>
                    <a class="navbar-brand" href="https://jaredtao.github.io">武威涛哥的博客</a>
                </div>
                <div class="collapse navbar-collapse" id="main-menu">
                    <ul class="menu">
                        
                            <li role="presentation" class="text-center">
                                <a href="/"><i class="fa "></i>首页</a>
                            </li>
                        
                            <li role="presentation" class="text-center">
                                <a href="/categories/Qml组件化编程/"><i class="fa "></i>Qml组件化编程</a>
                            </li>
                        
                            <li role="presentation" class="text-center">
                                <a href="/categories/Qml特效/"><i class="fa "></i>Qml特效</a>
                            </li>
                        
                            <li role="presentation" class="text-center">
                                <a href="/categories/Qt进阶之路/"><i class="fa "></i>Qt进阶之路</a>
                            </li>
                        
                            <li role="presentation" class="text-center">
                                <a href="/categories/C-修炼之路/"><i class="fa "></i>C++修炼之路</a>
                            </li>
                        
                            <li role="presentation" class="text-center">
                                <a href="/categories/武威故事/"><i class="fa "></i>武威故事</a>
                            </li>
                        
                            <li role="presentation" class="text-center">
                                <a href="/archives/"><i class="fa "></i>时间轴</a>
                            </li>
                        
                    </ul>
                </div>
            </div>
        </div>
    </div>
</nav>
    <section class="content-wrap">
        <div class="container">
            <div class="row">
                <main class="col-md-8 main-content m-post">
                    <p id="process"></p>
<article class="post">
    <div class="post-head">
        <h1 id="Qt项目持续集成系列之-github自动化发行">
            
	            Qt项目持续集成系列之-github自动化发行
            
        </h1>
        <div class="post-meta">
    
        <span class="categories-meta fa-wrap">
            <i class="fa fa-folder-open-o"></i>
            <a class="category-link" href="/categories/Qt进阶之路/">Qt进阶之路</a>
        </span>
    

    
        <span class="fa-wrap">
            <i class="fa fa-tags"></i>
            <span class="tags-meta">
                
                    <a class="tag-link" href="/tags/Qt/">Qt</a> <a class="tag-link" href="/tags/持续集成-CI/">持续集成(CI)</a>
                
            </span>
        </span>
    

    
        
        <span class="fa-wrap">
            <i class="fa fa-clock-o"></i>
            <span class="date-meta">2019/04/30</span>
        </span>
        
            <span class="fa-wrap">
                <i class="fa fa-eye"></i>
                <span id="busuanzi_value_page_pv"></span>
            </span>
        
    
</div>
            
            
            <p class="fa fa-exclamation-triangle warning">
                本文于<strong>317</strong>天之前发表，文中内容可能已经过时。
            </p>
        
    </div>
    
    <div id="post-gallery">
        
          <img src="/img/avatar.jpg" alt="gallery-img" class="gallery">
        
    </div>

    <div class="post-body post-content">
        <h2 id="简介"><a href="#简介" class="headerlink" title="简介"></a>简介</h2><p>本文的目标是，在github上实现Qt工程的自动化发行。</p>
<p>看个预览图先:<br><img src="/images/QtCI/28.png" alt="s"></p>
<p>上图所示github的Release中，包含了两个macos平台的dmg包、5个windows平台的zip包以及一个ubuntu平台的包，都是自动化发行的结果。</p>
<p>后续会加入Android和ios包。</p>
<p>不懂github持续集成的读者，请先去看上一篇文章</p>
<p><a href="https://jaredtao.github.io/2019/04/30/Qt%E8%87%AA%E5%8A%A8%E5%8C%96%E7%BC%96%E8%AF%91/">https://jaredtao.github.io/2019/04/30/Qt%E8%87%AA%E5%8A%A8%E5%8C%96%E7%BC%96%E8%AF%91/</a></p>
<p>接下来将要介绍Appveyor和Travis的配置</p>
<h2 id="Appveyor的配置"><a href="#Appveyor的配置" class="headerlink" title="Appveyor的配置"></a>Appveyor的配置</h2><p>上一篇文章中已经介绍过，Appveyor网站提供了windows的Docker镜像，包含各种版本的visual studio和Qt，这里通过yml配置文件，来使用这些镜像。</p>
<p>先是通过一个矩阵来配置不同的镜像</p>
<figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">environment:</span></span><br><span class="line"><span class="attr">  matrix:</span></span><br><span class="line"><span class="attr">  - APPVEYOR_BUILD_WORKER_IMAGE:</span> <span class="string">Visual</span> <span class="string">Studio</span> <span class="number">2015</span></span><br><span class="line"><span class="attr">    platform:</span> <span class="string">x86</span></span><br><span class="line"><span class="attr">    qt:</span> <span class="number">5.9</span></span><br><span class="line"><span class="attr">    releaseName:</span> <span class="string">HelloCI_qt59_vs2015_x86</span></span><br><span class="line"><span class="attr">  - APPVEYOR_BUILD_WORKER_IMAGE:</span> <span class="string">Visual</span> <span class="string">Studio</span> <span class="number">2015</span></span><br><span class="line"><span class="attr">    platform:</span> <span class="string">x64</span></span><br><span class="line"><span class="attr">    qt:</span> <span class="number">5.9</span></span><br><span class="line"><span class="attr">    releaseName:</span> <span class="string">HelloCI_qt59_vs2015_x64</span></span><br><span class="line"><span class="attr">  - APPVEYOR_BUILD_WORKER_IMAGE:</span> <span class="string">Visual</span> <span class="string">Studio</span> <span class="number">2017</span></span><br><span class="line"><span class="attr">    platform:</span> <span class="string">x64</span></span><br><span class="line"><span class="attr">    qt:</span> <span class="number">5.9</span></span><br><span class="line"><span class="attr">    releaseName:</span> <span class="string">HelloCI_qt59_vs2017_x64</span></span><br><span class="line"><span class="attr">  - APPVEYOR_BUILD_WORKER_IMAGE:</span> <span class="string">Visual</span> <span class="string">Studio</span> <span class="number">2015</span></span><br><span class="line"><span class="attr">    platform:</span> <span class="string">x64</span></span><br><span class="line"><span class="attr">    qt:</span> <span class="number">5.12</span></span><br><span class="line"><span class="attr">    releaseName:</span> <span class="string">HelloCI_qt512_vs2015_x64</span></span><br><span class="line"><span class="attr">  - APPVEYOR_BUILD_WORKER_IMAGE:</span> <span class="string">Visual</span> <span class="string">Studio</span> <span class="number">2017</span></span><br><span class="line"><span class="attr">    platform:</span> <span class="string">x64</span></span><br><span class="line"><span class="attr">    qt:</span> <span class="number">5.12</span></span><br><span class="line"><span class="attr">    releaseName:</span> <span class="string">HelloCI_qt512_vs2017_x64</span></span><br></pre></td></tr></table></figure>

<p>matrix之下，每一个‘-’号开头的一段描述，都代表一个镜像的配置。<br>其中APPVEYOR_BUILD_WORKER_IMAGE是网站提供的环境变量，用来指定Docker镜像。<br>platform、 qt以及releaseName是我自定义的变量，用来在后文中执行脚本时做区分</p>
<figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">before_build:</span></span><br><span class="line"><span class="bullet">  -</span> <span class="string">if</span> <span class="string">"%APPVEYOR_BUILD_WORKER_IMAGE%"</span><span class="string">=="Visual</span> <span class="string">Studio</span> <span class="number">2015</span><span class="string">" set msvc=msvc2015</span></span><br><span class="line"><span class="string">  - if "</span><span class="string">%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual</span> <span class="string">Studio</span> <span class="number">2015</span><span class="string">" set vs=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC</span></span><br><span class="line"><span class="string">  - if "</span><span class="string">%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual</span> <span class="string">Studio</span> <span class="number">2017</span><span class="string">" set msvc=msvc2017</span></span><br><span class="line"><span class="string">  - if "</span><span class="string">%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual</span> <span class="string">Studio</span> <span class="number">2017</span><span class="string">" set vs=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build</span></span><br><span class="line"><span class="string">  - if "</span><span class="string">%platform%"=="x86"</span> <span class="string">set</span> <span class="string">QTDIR=C:\Qt\%qt%\%msvc%</span></span><br><span class="line"><span class="bullet">  -</span> <span class="string">if</span> <span class="string">"%platform%"</span><span class="string">=="x64"</span> <span class="string">set</span> <span class="string">QTDIR=C:\Qt\%qt%\%msvc%_64</span></span><br><span class="line"><span class="bullet">  -</span> <span class="string">set</span> <span class="string">PATH=%PATH%;%QTDIR%\bin;</span></span><br><span class="line"><span class="bullet">  -</span> <span class="string">if</span> <span class="string">"%platform%"</span><span class="string">=="x86"</span> <span class="string">set</span> <span class="string">vcvarsall=%vs%\vcvarsall.bat</span></span><br><span class="line"><span class="bullet">  -</span> <span class="string">if</span> <span class="string">"%platform%"</span><span class="string">=="x64"</span> <span class="string">set</span> <span class="string">vcvarsall=%vs%\vcvarsall.bat</span></span><br><span class="line"><span class="bullet">  -</span> <span class="string">if</span> <span class="string">"%platform%"</span><span class="string">=="x86"</span> <span class="string">call</span> <span class="string">"%vcvarsall%"</span> <span class="string">x86</span></span><br><span class="line"><span class="bullet">  -</span> <span class="string">if</span> <span class="string">"%platform%"</span><span class="string">=="x64"</span> <span class="string">call</span> <span class="string">"%vcvarsall%"</span> <span class="string">x64</span></span><br></pre></td></tr></table></figure>

<p>before_build脚本，就是编译之前要执行的脚本，默认使用windows的cmd语法，当然也可以使用Powershell等。<br>我这段脚本目的是，在编译之前，先确认要使用的vs编译器和Qt所在路径。<br>vs一般通过调用vcvarsall.bat脚本，并传入x86或x64等参数，来确定相应的编译器和链接器，如cl.exe、nmake.exe等。<br>Qt的使用，是将QTDIR\bin设置到环境变量PATH中，以便可以找到qmake.exe。</p>
<figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">build_script:</span></span><br><span class="line"><span class="bullet">  -</span> <span class="string">qmake</span></span><br><span class="line"><span class="bullet">  -</span> <span class="string">nmake</span></span><br></pre></td></tr></table></figure>

<p>有了正确的环境设置，接下来就是编译了，很简单的qmake make</p>
<figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">after_build:</span></span><br><span class="line"><span class="bullet">  -</span> <span class="string">if</span> <span class="string">"%APPVEYOR_REPO_TAG%"</span><span class="string">=="true"</span> <span class="string">windeployqt</span> <span class="string">bin\HelloCI.exe</span> <span class="bullet">--qmldir</span> <span class="string">%QTDIR%\qml</span></span><br></pre></td></tr></table></figure>

<p>编译通过后，有一个after_build的脚本执行时机，此时的环境变量和前面一样。<br>我这段脚本目的是，在代码被打上tag的情况下，执行windeployqt命令，将依赖的Qt库都打包到一起。<br>APPVEYOR_REPO_TAG是Docker提供的环境变量，有tag的时候这个变量的值为true。</p>
<figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">artifacts:</span></span><br><span class="line"><span class="attr">  - path:</span> <span class="string">bin</span></span><br><span class="line"><span class="attr">    name:</span> <span class="string">$(releaseName)</span></span><br></pre></td></tr></table></figure>

<p>artifacts用来描述可以发行的代码包，这里指定了bin路径，则Docker会自动将bin路径打包为zip，zip的名字是指定的name。</p>
<figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">deploy:</span></span><br><span class="line"><span class="attr">  provider:</span> <span class="string">GitHub</span></span><br><span class="line"><span class="attr">  auth_token:</span> <span class="string">$(GITHUB_OAUTH_TOKEN)</span></span><br><span class="line"><span class="attr">  description:</span> <span class="string">'HelloCI Release'</span></span><br><span class="line"><span class="attr">  draft:</span> <span class="literal">false</span></span><br><span class="line"><span class="attr">  prerelease:</span> <span class="literal">false</span></span><br><span class="line"><span class="attr">  on:</span></span><br><span class="line"><span class="attr">      APPVEYOR_REPO_TAG:</span> <span class="literal">true</span></span><br></pre></td></tr></table></figure>

<p>deploy用来描述要发行的目标网站。<br> 这里的provider指定为github，就可以使用github的Release功能了。当然还有很多其它的网站也可用来发行。<br> auth_token是从github上生成的验证用的token，后面再说如何生成。为了不让别人看到具体token，这里引用了自定义的环境变量GITHUB_OAUTH_TOKEN</p>
<figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="string">on：</span> </span><br><span class="line">	<span class="attr">APPVEYOR_REPO_TAG:</span> <span class="literal">true</span></span><br></pre></td></tr></table></figure>

<p> 表示只有在代码被打上tag的时候，才执行deploy。<br> 这里的deploy没有指定artifacts，默认会把定义的artifacts都发行出去，这就够了。</p>
<p>最终的yml配置文件</p>
<p>appveyor.yml</p>
<figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">version:</span> <span class="string">'&#123;build&#125;'</span></span><br><span class="line"></span><br><span class="line"><span class="attr">branches:</span></span><br><span class="line"><span class="attr">  except:</span></span><br><span class="line"><span class="bullet">    -</span> <span class="string">project/travis</span></span><br><span class="line"><span class="attr">environment:</span></span><br><span class="line"><span class="attr">  matrix:</span></span><br><span class="line"><span class="attr">  - APPVEYOR_BUILD_WORKER_IMAGE:</span> <span class="string">Visual</span> <span class="string">Studio</span> <span class="number">2015</span></span><br><span class="line"><span class="attr">    platform:</span> <span class="string">x86</span></span><br><span class="line"><span class="attr">    qt:</span> <span class="number">5.9</span></span><br><span class="line"><span class="attr">    releaseName:</span> <span class="string">HelloCI_qt59_vs2015_x86</span></span><br><span class="line"><span class="attr">  - APPVEYOR_BUILD_WORKER_IMAGE:</span> <span class="string">Visual</span> <span class="string">Studio</span> <span class="number">2015</span></span><br><span class="line"><span class="attr">    platform:</span> <span class="string">x64</span></span><br><span class="line"><span class="attr">    qt:</span> <span class="number">5.9</span></span><br><span class="line"><span class="attr">    releaseName:</span> <span class="string">HelloCI_qt59_vs2015_x64</span></span><br><span class="line"><span class="attr">  - APPVEYOR_BUILD_WORKER_IMAGE:</span> <span class="string">Visual</span> <span class="string">Studio</span> <span class="number">2017</span></span><br><span class="line"><span class="attr">    platform:</span> <span class="string">x64</span></span><br><span class="line"><span class="attr">    qt:</span> <span class="number">5.9</span></span><br><span class="line"><span class="attr">    releaseName:</span> <span class="string">HelloCI_qt59_vs2017_x64</span></span><br><span class="line"><span class="attr">  - APPVEYOR_BUILD_WORKER_IMAGE:</span> <span class="string">Visual</span> <span class="string">Studio</span> <span class="number">2015</span></span><br><span class="line"><span class="attr">    platform:</span> <span class="string">x64</span></span><br><span class="line"><span class="attr">    qt:</span> <span class="number">5.12</span></span><br><span class="line"><span class="attr">    releaseName:</span> <span class="string">HelloCI_qt512_vs2015_x64</span></span><br><span class="line"><span class="attr">  - APPVEYOR_BUILD_WORKER_IMAGE:</span> <span class="string">Visual</span> <span class="string">Studio</span> <span class="number">2017</span></span><br><span class="line"><span class="attr">    platform:</span> <span class="string">x64</span></span><br><span class="line"><span class="attr">    qt:</span> <span class="number">5.12</span></span><br><span class="line"><span class="attr">    releaseName:</span> <span class="string">HelloCI_qt512_vs2017_x64</span></span><br><span class="line"><span class="attr">before_build:</span></span><br><span class="line"><span class="bullet">  -</span> <span class="string">if</span> <span class="string">"%APPVEYOR_BUILD_WORKER_IMAGE%"</span><span class="string">=="Visual</span> <span class="string">Studio</span> <span class="number">2015</span><span class="string">" set msvc=msvc2015</span></span><br><span class="line"><span class="string">  - if "</span><span class="string">%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual</span> <span class="string">Studio</span> <span class="number">2015</span><span class="string">" set vs=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC</span></span><br><span class="line"><span class="string">  - if "</span><span class="string">%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual</span> <span class="string">Studio</span> <span class="number">2017</span><span class="string">" set msvc=msvc2017</span></span><br><span class="line"><span class="string">  - if "</span><span class="string">%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual</span> <span class="string">Studio</span> <span class="number">2017</span><span class="string">" set vs=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build</span></span><br><span class="line"><span class="string">  - if "</span><span class="string">%platform%"=="x86"</span> <span class="string">set</span> <span class="string">QTDIR=C:\Qt\%qt%\%msvc%</span></span><br><span class="line"><span class="bullet">  -</span> <span class="string">if</span> <span class="string">"%platform%"</span><span class="string">=="x64"</span> <span class="string">set</span> <span class="string">QTDIR=C:\Qt\%qt%\%msvc%_64</span></span><br><span class="line"><span class="bullet">  -</span> <span class="string">set</span> <span class="string">PATH=%PATH%;%QTDIR%\bin;</span></span><br><span class="line"><span class="bullet">  -</span> <span class="string">if</span> <span class="string">"%platform%"</span><span class="string">=="x86"</span> <span class="string">set</span> <span class="string">vcvarsall=%vs%\vcvarsall.bat</span></span><br><span class="line"><span class="bullet">  -</span> <span class="string">if</span> <span class="string">"%platform%"</span><span class="string">=="x64"</span> <span class="string">set</span> <span class="string">vcvarsall=%vs%\vcvarsall.bat</span></span><br><span class="line"><span class="bullet">  -</span> <span class="string">if</span> <span class="string">"%platform%"</span><span class="string">=="x86"</span> <span class="string">call</span> <span class="string">"%vcvarsall%"</span> <span class="string">x86</span></span><br><span class="line"><span class="bullet">  -</span> <span class="string">if</span> <span class="string">"%platform%"</span><span class="string">=="x64"</span> <span class="string">call</span> <span class="string">"%vcvarsall%"</span> <span class="string">x64</span></span><br><span class="line"><span class="attr">build_script:</span></span><br><span class="line"><span class="bullet">  -</span> <span class="string">qmake</span></span><br><span class="line"><span class="bullet">  -</span> <span class="string">nmake</span></span><br><span class="line"><span class="attr">after_build:</span></span><br><span class="line"><span class="bullet">  -</span> <span class="string">if</span> <span class="string">"%APPVEYOR_REPO_TAG%"</span><span class="string">=="true"</span> <span class="string">windeployqt</span> <span class="string">bin\HelloCI.exe</span> <span class="bullet">--qmldir</span> <span class="string">%QTDIR%\qml</span></span><br><span class="line"><span class="attr">artifacts:</span></span><br><span class="line"><span class="attr">  - path:</span> <span class="string">bin</span></span><br><span class="line"><span class="attr">    name:</span> <span class="string">$(releaseName)</span></span><br><span class="line"><span class="attr">deploy:</span></span><br><span class="line"><span class="attr">  provider:</span> <span class="string">GitHub</span></span><br><span class="line"><span class="attr">  auth_token:</span> <span class="string">$(GITHUB_OAUTH_TOKEN)</span></span><br><span class="line"><span class="attr">  description:</span> <span class="string">'HelloCI Release'</span></span><br><span class="line"><span class="attr">  draft:</span> <span class="literal">false</span></span><br><span class="line"><span class="attr">  prerelease:</span> <span class="literal">false</span></span><br><span class="line"><span class="attr">  on:</span></span><br><span class="line"><span class="attr">      APPVEYOR_REPO_TAG:</span> <span class="literal">true</span></span><br></pre></td></tr></table></figure>

<h2 id="Travis"><a href="#Travis" class="headerlink" title="Travis"></a>Travis</h2><p>Travis网站有两个，<a href="https://travis-ci.org" target="_blank" rel="noopener">https://travis-ci.org</a> 和<a href="https://travis-ci.com，" target="_blank" rel="noopener">https://travis-ci.com，</a> 区别是后者可以操作github的私有仓库。</p>
<p>来看看travis的配置</p>
<figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">matrix:</span></span><br><span class="line"><span class="attr">  include:</span></span><br><span class="line"><span class="attr">    - os:</span> <span class="string">linux</span></span><br><span class="line"><span class="attr">      dist:</span> <span class="string">xenial</span></span><br><span class="line"><span class="attr">      env:</span> </span><br><span class="line">        <span class="string">targetFile=HelloCI</span></span><br><span class="line">        <span class="string">releaseName=HelloCI_ubuntu_xenial_x64</span></span><br><span class="line"><span class="attr">      cache:</span></span><br><span class="line"><span class="attr">        bundler:</span> <span class="literal">true</span></span><br><span class="line"><span class="attr">        apt:</span> <span class="literal">true</span></span><br><span class="line"><span class="attr">        directories:</span></span><br><span class="line"><span class="bullet">            -</span> <span class="string">/opt/qt512/</span></span><br><span class="line"><span class="attr">    - os:</span> <span class="string">osx</span></span><br><span class="line"><span class="attr">      osx_image:</span> <span class="string">xcode10.2</span></span><br><span class="line"><span class="attr">      env:</span> </span><br><span class="line">        <span class="string">targetFile=HelloCI</span></span><br><span class="line">        <span class="string">releaseName=HelloCI_macos10-14_xcode10-2.dmg</span></span><br><span class="line"><span class="attr">      cache:</span></span><br><span class="line"><span class="attr">        bundler:</span> <span class="literal">true</span></span><br><span class="line"><span class="attr">        directories:</span></span><br><span class="line"><span class="bullet">            -</span> <span class="string">/usr/local/Cellar/qt/5.12.2/</span></span><br><span class="line"><span class="attr">    - os:</span> <span class="string">osx</span></span><br><span class="line"><span class="attr">      osx_image:</span> <span class="string">xcode9.4</span></span><br><span class="line"><span class="attr">      env:</span> </span><br><span class="line">        <span class="string">targetFile=HelloCI</span></span><br><span class="line">        <span class="string">releaseName=HelloCI_macos10-13_xcode9-4.dmg</span></span><br><span class="line"><span class="attr">      cache:</span></span><br><span class="line"><span class="attr">        bundler:</span> <span class="literal">true</span></span><br><span class="line"><span class="attr">        directories:</span></span><br><span class="line"><span class="bullet">            -</span> <span class="string">/usr/local/Cellar/qt/5.12.2/</span></span><br></pre></td></tr></table></figure>

<p>其中</p>
<figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">os:</span> <span class="string">linux</span></span><br><span class="line"><span class="attr">  dist:</span> <span class="string">xenial</span></span><br></pre></td></tr></table></figure>

<p>这是ubuntu16.04的配置（目前还不支持18.04 bionic）<br>env中自定义了一些环境变量，后面用到<br>cache是用来缓存的，这里指定了Qt的安装路径，那么在下一次同样的Docker镜像启动时，优先使用缓存，除非没有安装或者有新版本才会去更新这个路径。这样可以节省大量的Docker运行时间哦。</p>
<figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">    os:</span> <span class="string">osx</span></span><br><span class="line"><span class="attr">      osx_image:</span> <span class="string">xcode10.2</span></span><br><span class="line"><span class="string">```</span>      </span><br><span class="line"><span class="string">这是macos系统的设置，osx_image是travis提供的，可在其文档中找到其它可用版本</span></span><br><span class="line"><span class="attr">https:</span><span class="string">//docs.travis-ci.com/user/reference/osx/</span></span><br><span class="line"><span class="string">缓存也是要有的。</span></span><br><span class="line">  </span><br><span class="line"></span><br><span class="line"><span class="string">osx系统通过brew安装Qt，只需要一条命令即可</span> <span class="string">brew</span> <span class="string">install</span> <span class="string">qt，按照brew官网`https://brew.sh/`的描述，目前安装的版本为5.12.2</span></span><br><span class="line"><span class="string">涛哥试过后，发现安装路径是/usr/local/Cellar/qt/5.12.2/</span></span><br><span class="line"></span><br><span class="line"><span class="string">ubuntu系统安装Qt，上一篇文章也说过了，是通过launchpad源，目前已经有了最新的5.12.2和5.12.3了。</span></span><br><span class="line"></span><br><span class="line"><span class="string">最终的travis.yml</span></span><br><span class="line"><span class="string">```yml</span></span><br><span class="line"><span class="comment">#dist: xenial</span></span><br><span class="line"><span class="comment">#指定语言为cpp</span></span><br><span class="line"><span class="attr">language:</span> <span class="string">cpp</span></span><br><span class="line"><span class="comment">#需要sudu权限</span></span><br><span class="line"><span class="attr">sudo:</span> <span class="string">required</span></span><br><span class="line"><span class="comment">#编译器为gcc</span></span><br><span class="line"><span class="attr">compiler:</span> <span class="string">gcc</span></span><br><span class="line"><span class="comment">#环境变量</span></span><br><span class="line"><span class="comment">#env: QT_BASE="512"</span></span><br><span class="line"></span><br><span class="line"><span class="attr">matrix:</span></span><br><span class="line"><span class="attr">  include:</span></span><br><span class="line"><span class="attr">    - os:</span> <span class="string">linux</span></span><br><span class="line"><span class="attr">      dist:</span> <span class="string">xenial</span></span><br><span class="line"><span class="attr">      env:</span> </span><br><span class="line">        <span class="string">targetFile=HelloCI</span></span><br><span class="line">        <span class="string">releaseName=HelloCI_ubuntu_xenial_x64</span></span><br><span class="line"><span class="attr">      cache:</span></span><br><span class="line"><span class="attr">        bundler:</span> <span class="literal">true</span></span><br><span class="line"><span class="attr">        apt:</span> <span class="literal">true</span></span><br><span class="line"><span class="attr">        directories:</span></span><br><span class="line"><span class="bullet">            -</span> <span class="string">/opt/qt512/</span></span><br><span class="line"><span class="attr">    - os:</span> <span class="string">osx</span></span><br><span class="line"><span class="attr">      osx_image:</span> <span class="string">xcode10.2</span></span><br><span class="line"><span class="attr">      env:</span> </span><br><span class="line">        <span class="string">targetFile=HelloCI</span></span><br><span class="line">        <span class="string">releaseName=HelloCI_macos10-14_xcode10-2.dmg</span></span><br><span class="line"><span class="attr">      cache:</span></span><br><span class="line"><span class="attr">        bundler:</span> <span class="literal">true</span></span><br><span class="line"><span class="attr">        directories:</span></span><br><span class="line"><span class="bullet">            -</span> <span class="string">/usr/local/Cellar/qt/5.12.2/</span></span><br><span class="line"><span class="attr">    - os:</span> <span class="string">osx</span></span><br><span class="line"><span class="attr">      osx_image:</span> <span class="string">xcode9.4</span></span><br><span class="line"><span class="attr">      env:</span> </span><br><span class="line">        <span class="string">targetFile=HelloCI</span></span><br><span class="line">        <span class="string">releaseName=HelloCI_macos10-13_xcode9-4.dmg</span></span><br><span class="line"><span class="attr">      cache:</span></span><br><span class="line"><span class="attr">        bundler:</span> <span class="literal">true</span></span><br><span class="line"><span class="attr">        directories:</span></span><br><span class="line"><span class="bullet">            -</span> <span class="string">/usr/local/Cellar/qt/5.12.2/</span></span><br><span class="line">  </span><br><span class="line"><span class="comment">#缓存</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 注意上面的缓存,指定qt安装路径，可以避免重复安装</span></span><br><span class="line"></span><br><span class="line"><span class="comment">#组</span></span><br><span class="line"><span class="attr">group:</span> <span class="string">deprecated-2019Q1</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># travis默认系统为ubuntu，并提供一些基础的命令。但是没有安装Qt，需要通过ubuntu源进行安装。</span></span><br><span class="line"><span class="comment"># 关于ubuntu源 在这个网站上查看细节 https://launchpad.net/~beineri/+archive/ubuntu/</span></span><br><span class="line"><span class="comment"># 当然也可以通过qt安装包 +一些命令的方式来安装，这里以源的方式为主。</span></span><br><span class="line"><span class="comment">#安装前的设置</span></span><br><span class="line"><span class="comment">#添加qt5.12.1的源</span></span><br><span class="line"><span class="attr">before_install:</span></span><br><span class="line"><span class="bullet">    -</span> <span class="string">if</span> <span class="string">[[</span> <span class="string">"$TRAVIS_OS_NAME"</span> <span class="string">==</span> <span class="string">"osx"</span> <span class="string">]];</span> <span class="string">then</span> <span class="string">brew</span> <span class="string">update;</span> <span class="string">brew</span> <span class="string">install</span> <span class="string">qt;</span> <span class="string">fi</span> </span><br><span class="line"><span class="bullet">    -</span> <span class="string">if</span> <span class="string">[[</span> <span class="string">"$TRAVIS_OS_NAME"</span> <span class="string">==</span> <span class="string">"linux"</span> <span class="string">]];</span> <span class="string">then</span> <span class="string">sudo</span> <span class="string">add-apt-repository</span> <span class="attr">ppa:beineri/opt-qt-5.12.3-xenial</span> <span class="bullet">-y;</span> <span class="string">sudo</span> <span class="string">apt-get</span> <span class="string">update</span> <span class="bullet">-qq;</span> <span class="string">sudo</span> <span class="string">apt-get</span> <span class="string">install</span> <span class="bullet">-y</span> <span class="string">libglew-dev</span> <span class="string">libglfw3-dev;</span> <span class="string">sudo</span> <span class="string">apt-get</span> <span class="string">install</span> <span class="bullet">-y</span> <span class="string">qt512-meta-minimal;</span> <span class="string">fi</span></span><br><span class="line"><span class="comment"># 单独安装qt3d模块的示例</span></span><br><span class="line"><span class="comment">#    - sudo apt-get install -y qt5123d</span></span><br><span class="line"></span><br><span class="line"><span class="attr">before_script:</span></span><br><span class="line"><span class="bullet">    -</span> <span class="string">if</span> <span class="string">[[</span> <span class="string">"$TRAVIS_OS_NAME"</span> <span class="string">==</span> <span class="string">"linux"</span> <span class="string">]];</span> <span class="string">then</span> <span class="string">source</span> <span class="string">/opt/qt512/bin/qt512-env.sh;</span> <span class="string">fi</span></span><br><span class="line"><span class="attr">script:</span></span><br><span class="line"><span class="bullet">    -</span> <span class="string">if</span> <span class="string">[[</span> <span class="string">"$TRAVIS_OS_NAME"</span> <span class="string">==</span> <span class="string">"linux"</span> <span class="string">]];</span> <span class="string">then</span> <span class="string">source</span> <span class="string">/opt/qt512/bin/qt512-env.sh;</span> <span class="string">qmake</span> <span class="string">;</span> <span class="string">make</span> <span class="string">;</span> <span class="string">fi</span></span><br><span class="line"><span class="bullet">    -</span> <span class="string">if</span> <span class="string">[[</span> <span class="string">"$TRAVIS_OS_NAME"</span> <span class="string">==</span> <span class="string">"osx"</span> <span class="string">]];</span> <span class="string">then</span> <span class="string">/usr/local/Cellar/qt/5.12.2/bin/qmake</span> <span class="string">;</span> <span class="string">make</span> <span class="string">;</span> <span class="string">fi</span></span><br><span class="line"><span class="attr">before_deploy:</span></span><br><span class="line"><span class="bullet">    -</span> <span class="string">if</span> <span class="string">[[</span> <span class="string">"$TRAVIS_OS_NAME"</span> <span class="string">==</span> <span class="string">"osx"</span> <span class="string">]];</span> <span class="string">then</span> <span class="string">/usr/local/Cellar/qt/5.12.2/bin/macdeployqt</span> <span class="string">bin/$&#123;targetFile&#125;.app</span> <span class="bullet">-qmldir=/usr/local/Cellar/qt/5.12.2/qml</span> <span class="bullet">-verbose=1</span> <span class="bullet">-dmg</span> <span class="string">;</span> <span class="string">mv</span> <span class="string">bin/$&#123;targetFile&#125;.dmg</span> <span class="string">bin/$&#123;releaseName&#125;</span> <span class="string">;</span> <span class="string">fi</span></span><br><span class="line"><span class="bullet">    -</span> <span class="string">if</span> <span class="string">[[</span> <span class="string">"$TRAVIS_OS_NAME"</span> <span class="string">==</span> <span class="string">"linux"</span> <span class="string">]];</span> <span class="string">then</span> <span class="string">mv</span> <span class="string">bin/$&#123;targetFile&#125;</span> <span class="string">bin/$&#123;releaseName&#125;</span> <span class="string">;</span> <span class="string">fi</span></span><br><span class="line"><span class="attr">deploy:</span>              <span class="comment"># 部署</span></span><br><span class="line"><span class="attr">  provider:</span> <span class="string">releases</span> <span class="comment"># 部署到 GitHub Release，除此之外，Travis CI 还支持发布到 fir.im、AWS、Google App Engine 等</span></span><br><span class="line"><span class="attr">  api_key:</span> <span class="string">$GITHUB_OAUTH_TOKEN</span> <span class="comment"># 填写 GitHub 的 token （Settings -&gt; Personal access tokens -&gt; Generate new token）</span></span><br><span class="line"><span class="attr">  file:</span> <span class="string">bin/$&#123;releaseName&#125;</span>   <span class="comment"># 部署文件路径</span></span><br><span class="line"><span class="attr">  skip_cleanup:</span> <span class="literal">true</span>     <span class="comment"># 设置为 true 以跳过清理,不然 apk 文件就会被清理</span></span><br><span class="line"><span class="attr">  on:</span>     <span class="comment"># 发布时机           </span></span><br><span class="line"><span class="attr">    tags:</span> <span class="literal">true</span>       <span class="comment"># tags 设置为 true 表示只有在有 tag 的情况下才部署   </span></span><br><span class="line"><span class="attr">notifications:</span></span><br><span class="line"><span class="attr">    email:</span> <span class="literal">false</span></span><br></pre></td></tr></table></figure>

<h2 id="OAuth-token"><a href="#OAuth-token" class="headerlink" title="OAuth token"></a>OAuth token</h2><p>OAuth机制，是在不知道密码的情况下，只通过授权的token去访问特定的api。</p>
<p>使用token大致步骤：<br><img src="/images/QtCI/29.png" alt="s"><br><img src="/images/QtCI/30.png" alt="s"><br><img src="/images/QtCI/31.png" alt="s"><br><img src="/images/QtCI/32.png" alt="s"><br><img src="/images/QtCI/33.png" alt="s"><br><img src="/images/QtCI/34.png" alt="s"></p>
<p>接下来要去两个地方粘贴，最好先贴到记事本或着什么地方，备用。</p>
<p>先到Travis的项目配置页面<br><img src="/images/QtCI/35.png" alt="s"><br><img src="/images/QtCI/36.png" alt="s"></p>
<p>Name写前面的yml配置文件中引用的变量名GITHUB_OAUTH_TOKEN,value就是前面的token</p>
<p>接下来是Appveyor<br><img src="/images/QtCI/37.png" alt="s"><br><img src="/images/QtCI/38.png" alt="s"></p>
<p>一样的东西，填好后保存即可。</p>
<p>最后，给代码打上tag，提交吧。</p>
<p>涛哥在连续提交了50多次后。。。<br><img src="/images/QtCI/39.png" alt="s"><br>最终拿到了这两个徽章<br><img src="/images/QtCI/40.png" alt="s"><br>还有这正确的发布包。<br>（ubuntu那个，缺少linuxdeployqt打包步骤，后面再加）<br><img src="/images/QtCI/28.png" alt="s"></p>
<p>当然，你们不用像我一样提交50多次，你们可以直接用我写好的配置文件。</p>
<p>最后附上GitHub链接<br><a href="https://github.com/jaredtao/HelloCI" target="_blank" rel="noopener">https://github.com/jaredtao/HelloCI</a></p>

    </div>
    
        <div class="reward" ontouchstart>
    <div class="reward-wrap">赏
        <div class="reward-box">
            
                <span class="reward-type">
                    <img class="alipay" src="/img/zhifubao.jpg"><b>支付宝打赏</b>
                </span>
            
            
                <span class="reward-type">
                    <img class="wechat" src="/img/weixin.jpg"><b>微信打赏</b>
                </span>
            
        </div>
    </div>
    <p class="reward-tip">赞赏是不耍流氓的鼓励</p>
</div>


    
    <div class="post-footer">
        <div>
            
                转载声明：文章采用<a href="http://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议</a>进行许可, 转载请注明出处 © <a href="https://jaredtao.github.io" target="_blank">武威的涛哥</a>
            
        </div>
        <div>
            
        </div>
    </div>
</article>

<div class="article-nav prev-next-wrap clearfix">
    
        <a href="/2019/04/30/Qt自制简易好看的日志系统/" class="pre-post btn btn-default" title='Qt自制简易好看的日志系统'>
            <i class="fa fa-angle-left fa-fw"></i><span class="hidden-lg">上一篇</span>
            <span class="hidden-xs">Qt自制简易好看的日志系统</span>
        </a>
    
    
        <a href="/2019/04/30/Qt自动化编译/" class="next-post btn btn-default" title='Qt项目持续集成系列之-github自动化编译'>
            <span class="hidden-lg">下一篇</span>
            <span class="hidden-xs">Qt项目持续集成系列之-github自动化编译</span><i class="fa fa-angle-right fa-fw"></i>
        </a>
    
</div>


    <div id="comments">
        
	
    <div id="vcomments" class="valine"></div>
    <script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
<script src="/assets/valine.min.js"></script>

    <script>
        new Valine({
            av: AV,
            el: '#vcomments',
            appId: 'qegD4552u6FU9HoNDvRsonko-gzGzoHsz',
            appKey: 'eitB2FV5n2qyMHcDM7x6EQpt',
            placeholder: '说点什么吧',
            notify: false,
            verify: false,
            avatar: 'mm',
            meta: 'nick,mail'.split(','),
            pageSize: '10',
            path: window.location.pathname,
            lang: 'zh-CN'.toLowerCase()
        })
    </script>


    </div>





                </main>
                
                    <aside id="article-toc" role="navigation" class="col-md-4">
    <div class="widget">
        <h3 class="title">文章目录</h3>
        
            <ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#简介"><span class="toc-text">简介</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Appveyor的配置"><span class="toc-text">Appveyor的配置</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Travis"><span class="toc-text">Travis</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#OAuth-token"><span class="toc-text">OAuth token</span></a></li></ol>
        
    </div>
</aside>

                
            </div>
        </div>
    </section>
    <footer class="main-footer">
    <div class="container">
        <div class="row">
        </div>
    </div>
</footer>

<a id="back-to-top" class="icon-btn hide">
	<i class="fa fa-chevron-up"></i>
</a>




    <div class="copyright">
    <div class="container">
        <div class="row">
            <div class="col-sm-12">
                <div class="busuanzi">
    
        访问量:
        <strong id="busuanzi_value_site_pv">
            <i class="fa fa-spinner fa-spin"></i>
        </strong>
        &nbsp; | &nbsp;
        访客数:
        <strong id="busuanzi_value_site_uv">
            <i class="fa fa-spinner fa-spin"></i>
        </strong>
    
</div>

            </div>
            <div class="col-sm-12">
                <span>Copyright &copy;
                    2019
                    
                </span> |
                <span>
                    Powered by <a href="//hexo.io" class="copyright-links" target="_blank" rel="nofollow">Hexo</a>
                </span> |
                <span>
                    Theme by <a href="//github.com/shenliyang/hexo-theme-snippet.git" class="copyright-links" target="_blank" rel="nofollow">Snippet</a>
                </span>
            </div>
        </div>
    </div>
</div>




    <script src="/assets/tagcanvas.min.js?rev=2.9"></script>
    <script>
        var tagOption = {
            textColour: '#444', // 字体颜色
            outlineMethod: 'block', // 选中模式
            outlineColour: '#FFDAB9', // 选中模式的颜色
            interval: 30 || 30, // 动画帧之间的时间间隔，值越大，转动幅度越大
            textHeight: 13,
            outlineRadius: 3,
            freezeActive: true || '', // 选中的标签是否继续滚动
            frontSelect: true || '', // 不选标签云后部的标签
            initial: [0.1, -0.1],
            depth: 0.5,
            decel: 0.95,
            maxSpeed: 0.03,
            reverse: true || '', // 是否反向触发
            fadeIn: 500, // 进入动画时间
            wheelZoom: false || '' // 是否启用鼠标滚轮
        }
        TagCanvas.Start('tag-cloud-3d','',tagOption);
    </script>



    <script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>


<script src="/js/app.js?rev=@@hash"></script>

</body>
</html>